package com.zhn.shortlink.admin.controller;


import com.zhn.shortlink.admin.common.convention.result.Result;
import com.zhn.shortlink.admin.remote.ShortLinkService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class UrlTitleController {

    private final ShortLinkService shortLinkService;
    @GetMapping("/api/short-link/admin/v1/title")
    public Result<String> getUrlTitle(@RequestParam("url") String url){
        return shortLinkService.getTitleByUrl(url);
    }

}
